# i n c l u d e   < m e g a 8 . h >               / / 181;8>B5:0  22>40\ 2K2>40
 
 # i n c l u d e   < 1 w i r e . h >               / / 181;8>B5:0  4;O  @01>BK  A  1 W i r e 
 
 # i n c l u d e   < d s 1 8 b 2 0 . h >               / / 181;8>B5:0  4;O  @01>BK  A  40BG8:><  B5<?5@0BC@K# a s m   / / 3>2>@8<  :C40  C  =0A  ?>4:;NG5=  40BG8:
 
 . e q u _ _ w 1 _ p o r t = 0  1 5 ;     P O R T C 
 
 . e q u _ _ w 1 _ b i t = 0 
 
 # e n d a s m 
 
 # i n c l u d e   < d e l a y . h >               / / 181;8>B5:0  7045@6:8
 
 # i n c l u d e   < s t d i o . h >               / / 181;8>B5:0  4;O  2K2>40  40==KE  2  U S A R T 
 
 i n t   t e m p ;               / / ?5@5<5==0O  4;O  B5<?5@0BC@K
 
 
 
 
 
 v o i d   m a i n ( v o i d ) 
 
 { 
 
 / / U S A R T   i n i t i a l i z a t i o n / / C o m m u n i c a t i o n   P a r a m e t e r s :   8   D a t a ,   1   S t o p ,   N o   P a r i t y / / U S A R T   R e c e i v e r :   O f f 
 
 / / U S A R T   T r a n s m i t t e r :   O n 
 
 / / U S A R T   M o d e :   A s y n c h r o n o u s 
 
 / / U S A R T   B a u d   R a t e :   9 6 0 0 
 
 U C S R A = 0  0 0 ; 
 
 
 
 U C S R B = 0  0 8 ; 
 
 U C S R C = 0  8 6 ; 
 
 U B R R H = 0  0 0 ; 
 
 U B R R L = 0  3 3 ; 
 
 
 
 w 1 _ i n i t ( ) ;               / / 8=8F80;870F8O  H8=K  1 W i r e 
 
 p r i n t f (  P o w e r _ O K   \ n   \ r ) ;               / / >BAK;05<  2    A>>1I5=85   P o w e r _ O K  
 
 w h i l e   ( 1 ) 
 
 { 
 
 d s 1 8 b 2 0 _ t e m p e r a t u r e ( 0 ) ;             / / <5@O5<
 
 B5<?5@0BC@C  A  ?5@2>3>  40BG8:0
 
 i f ( t e m p > 1 0 0 0 )             / / 4;O  <8=CA>2>9  B5<?5@0BC@K
 
 {     t e m p = 4 0 9 6 - t e m p ;               / / >B=8<05<  >B  7=0G5=8O  4 0 9 6 
 
 t e m p = - t e m p ;               / / AB028<  ?@>B82>?>;>6=K9  7=0:
 
 } 
 
 p r i n t f (  T e m p e r a t u r e :   % i \ x f 8 C  ,   t e m p ) ;               / / 2K2>48<  B5<?5@0BC@C  =0  
 
 p r i n t f (  \ n \ r  ) ;               / / ?5@5E>48<  =0  A;54CNICN  AB@>:C
 
 d e l a y _ m s ( 5 0 0 ) ;               / / 64Q<
 
 } ; 
 
 } 